package cn.skyclass.events
{
	import cn.skyclass.controls.IListItem;
	
	import flash.events.Event;
	
	/**
	 * 和列表项操作相关的事件
	 */
	public class ListItemEvent extends Event
	{
		public static const SELECT_ITEM:String = "selectItem";
		public static const ADD_ITEM:String = "addItem";
		public static const REMOVE_ITEM:String = "removeItem";		
		public static const ITEM_CREATED:String = "itemCreated";
		public static const DOUBLE_CLICK_ITEM:String = "doubleClickItem";
		
		/**
		 *  the index of item in the list which its belongs to
		 */
		public var itemIndex:int;
		
		public var item:IListItem;
		
		public var itemDatasource:Object;
		
		public function ListItemEvent(type:String, item:IListItem, itemIndex:int=0){
			super(type);
			this.item = item;
			this.itemIndex = itemIndex;
		}
		
		override public function clone():Event{
			var e:ListItemEvent = new ListItemEvent(this.type, this.item, this.itemIndex);
			e.itemDatasource = this.itemDatasource;
			return e;
		}			
	}
}